<script lang='ts' setup>
import { reactive } from 'vue';
import { ElNotification } from 'element-plus'
import { removeAllCache, removeCacheCodeList, removeBeanCache, removeCacheTreeList, removeOrgCache } from '/@/api/org/bomf-cache'

const BomfCacheState = reactive({
    onRemoveAllCache: () => {
        removeAllCache().then(() => ElNotification({ title: '成功', message: '刷新所有缓存成功', type: 'success' }))
    },
    onRmoveCacheCodeList: () => {
        removeCacheCodeList().then(() => ElNotification({ title: '成功', message: '刷新数据字典缓存成功', type: 'success' }))
    },
    onRemoveCacheTreeList: () => {
        removeCacheTreeList().then(() => ElNotification({ title: '成功', message: '刷新树缓存成功', type: 'success' }))
    },
    onRemoveOrgCache: () => {
        removeOrgCache().then(() => ElNotification({ title: '成功', message: '刷新组织机构缓存成功', type: 'success' }))
    },
    onRemoveBeanCache: () => {
        removeBeanCache().then(() => ElNotification({ title: '成功', message: '刷新bean缓存成功', type: 'success' }))
    }
})
</script>
<template>
    <jxtech-basic-header></jxtech-basic-header>
    <el-button type="primary" @click="BomfCacheState.onRemoveAllCache">刷新所有缓存</el-button>
    <el-button type="success" @click="BomfCacheState.onRmoveCacheCodeList">刷新数据字典</el-button>
    <el-button type="info" @click="BomfCacheState.onRemoveCacheTreeList">刷新树</el-button>
    <el-button type="warning" @click="BomfCacheState.onRemoveOrgCache">刷新组织机构</el-button>
    <el-button type="danger" @click="BomfCacheState.onRemoveBeanCache">刷新bean缓存</el-button>
</template>